﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.TD
{
	public class OdAveBGOpt : IDisposable
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdAveBGOpt(IntPtr cPtr, bool cMemoryOwn)
		{
			this.swigCMemOwn = cMemoryOwn;
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdAveBGOpt obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdAveBGOpt()
		{
			this.Dispose();
		}

		public virtual void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							TD_DbPINVOKE.delete_OdAveBGOpt(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
		}

		public OdAveBGOpt() : this(TD_DbPINVOKE.new_OdAveBGOpt(), true)
		{
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public BackgroundType m_BgType
		{
			get
			{
				BackgroundType result = (BackgroundType)TD_DbPINVOKE.OdAveBGOpt_m_BgType_get(this.swigCPtr);
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				TD_DbPINVOKE.OdAveBGOpt_m_BgType_set(this.swigCPtr, (int)value);
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public OdAveBitmap m_pImage
		{
			get
			{
				IntPtr intPtr = TD_DbPINVOKE.OdAveBGOpt_m_pImage_get(this.swigCPtr);
				OdAveBitmap result = (intPtr == IntPtr.Zero) ? null : new OdAveBitmap(intPtr, false);
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				TD_DbPINVOKE.OdAveBGOpt_m_pImage_set(this.swigCPtr, OdAveBitmap.getCPtr(value));
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public bool m_bDefaultBackground
		{
			get
			{
				bool result = TD_DbPINVOKE.OdAveBGOpt_m_bDefaultBackground_get(this.swigCPtr);
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				TD_DbPINVOKE.OdAveBGOpt_m_bDefaultBackground_set(this.swigCPtr, value);
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public uint m_SolidColor
		{
			get
			{
				uint result = TD_DbPINVOKE.OdAveBGOpt_m_SolidColor_get(this.swigCPtr);
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				TD_DbPINVOKE.OdAveBGOpt_m_SolidColor_set(this.swigCPtr, value);
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public uint m_GrColor1
		{
			get
			{
				uint result = TD_DbPINVOKE.OdAveBGOpt_m_GrColor1_get(this.swigCPtr);
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				TD_DbPINVOKE.OdAveBGOpt_m_GrColor1_set(this.swigCPtr, value);
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public uint m_GrColor2
		{
			get
			{
				uint result = TD_DbPINVOKE.OdAveBGOpt_m_GrColor2_get(this.swigCPtr);
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				TD_DbPINVOKE.OdAveBGOpt_m_GrColor2_set(this.swigCPtr, value);
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public uint m_GrColor3
		{
			get
			{
				uint result = TD_DbPINVOKE.OdAveBGOpt_m_GrColor3_get(this.swigCPtr);
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				TD_DbPINVOKE.OdAveBGOpt_m_GrColor3_set(this.swigCPtr, value);
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public double m_dGrHorizon
		{
			get
			{
				double result = TD_DbPINVOKE.OdAveBGOpt_m_dGrHorizon_get(this.swigCPtr);
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				TD_DbPINVOKE.OdAveBGOpt_m_dGrHorizon_set(this.swigCPtr, value);
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public double m_dGrHeight
		{
			get
			{
				double result = TD_DbPINVOKE.OdAveBGOpt_m_dGrHeight_get(this.swigCPtr);
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				TD_DbPINVOKE.OdAveBGOpt_m_dGrHeight_set(this.swigCPtr, value);
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public double m_dGrRotation
		{
			get
			{
				double result = TD_DbPINVOKE.OdAveBGOpt_m_dGrRotation_get(this.swigCPtr);
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				TD_DbPINVOKE.OdAveBGOpt_m_dGrRotation_set(this.swigCPtr, value);
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public bool m_bEnvBackground
		{
			get
			{
				bool result = TD_DbPINVOKE.OdAveBGOpt_m_bEnvBackground_get(this.swigCPtr);
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				TD_DbPINVOKE.OdAveBGOpt_m_bEnvBackground_set(this.swigCPtr, value);
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public string m_EnvImageName
		{
			get
			{
				string result = TD_DbPINVOKE.OdAveBGOpt_m_EnvImageName_get(this.swigCPtr);
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				TD_DbPINVOKE.OdAveBGOpt_m_EnvImageName_set(this.swigCPtr, value);
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		private object locker = new object();

		private HandleRef swigCPtr;

		protected bool swigCMemOwn;
	}
}
